import $axios from "@/network";

/**
 * {查询个人信息}
 *
 * @author: 宋康
 * @date: 2022/8/17 17:37
 */
export const userOneself = () => {
  return $axios({
    method: 'GET',
    url: '/user/query/info',
  })
}

/**
 * {编辑个人信息}
 * @param option
 * @author: 宋康
 * @date: 2022/8/17 17:37
 */
export const editUserOneself = (option) => {
  return $axios({
    method: 'POST',
    url: '/user/edit/oneself',
    data: {
      ...option
    }
  })
}

/**
 * 修改个人密码
 * @returns {*}
 */
export const updatedPwd = (oldPwd, newPWd, newPWdTwo) => {
  return $axios({
    method: 'POST',
    url: '/user/updated/pwd',
    data: {
      "newPWd": newPWd,
      "newPWdTwo": newPWdTwo,
      "oldPwd": oldPwd,
    }
  })
}


/**
 * 查询个人操作日志
 * @returns {*}
 */
export const queryUserLog = (current, size) => {
  return $axios({
    method: 'GET',
    url: '/logs/log/query/page/o',
    params: {
      "current": current,
      "size": size,
    }
  })
}